using B.S.Medical.ErrorCode;
using MediatR;
using System;
using System.Collections.Generic;

namespace B.S.Medical.Api.Read.Application.Command.Payment
{
    /// <summary>
    /// 查询患者余额和充值记录命令
    /// </summary>
    public class GetPatientBalanceCommand : IRequest<ApiResult<PatientBalanceInfoDto>>
    {
        /// <summary>
        /// 患者ID
        /// </summary>
        public int PatientId { get; set; }
        
        /// <summary>
        /// 开始日期（默认为一年前）
        /// </summary>
        public DateTime? StartDate { get; set; }
        
        /// <summary>
        /// 结束日期（默认为当前日期）
        /// </summary>
        public DateTime? EndDate { get; set; }
    }
    
    /// <summary>
    /// 患者余额和充值记录信息DTO
    /// </summary>
    public class PatientBalanceInfoDto
    {
        /// <summary>
        /// 患者ID
        /// </summary>
        public int PatientId { get; set; }
        
        /// <summary>
        /// 患者姓名
        /// </summary>
        public string PatientName { get; set; }
        
        /// <summary>
        /// 就诊卡号
        /// </summary>
        public string IdCard { get; set; }
        
        /// <summary>
        /// 手机号码
        /// </summary>
        public string PhoneNumber { get; set; }
        
        /// <summary>
        /// 当前余额
        /// </summary>
        public decimal CurrentBalance { get; set; }
        
        /// <summary>
        /// 最后充值时间
        /// </summary>
        public DateTime? LastRechargeTime { get; set; }
        
        /// <summary>
        /// 充值记录列表
        /// </summary>
        public List<RechargeRecordDto> RechargeRecords { get; set; } = new List<RechargeRecordDto>();
    }
    
    /// <summary>
    /// 充值记录DTO
    /// </summary>
    public class RechargeRecordDto
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public int Id { get; set; }
        
        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderNo { get; set; }
        
        /// <summary>
        /// 充值金额
        /// </summary>
        public decimal Amount { get; set; }
        
        /// <summary>
        /// 支付方式
        /// </summary>
        public string PayType { get; set; }
        
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PayTime { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; }
        
        /// <summary>
        /// 支付状态
        /// </summary>
        public string PayStatus { get; set; }
    }
} 